<template>
  <AMenuItem :key="itemKey">
    <span class="flex items-center">
      <GIcon :icon="icon" class="mr-1" />
      <span>{{ text }}</span>
    </span>
  </AMenuItem>
</template>
<script lang="ts">
  import { propTypes } from '/@/utils/propTypes';

  export default defineComponent({
    name: 'GDropdownMenuItem',

    props: {
      // eslint-disable-next-line
      key: propTypes.string,
      text: propTypes.string,
      icon: propTypes.string,
    },
    setup(props) {
      const instance = getCurrentInstance();
      const itemKey = computed(() => props.key || instance?.vnode?.props?.key);
      return { itemKey };
    },
  });
</script>
